docs: Add "Accessibility" section to various widgets
authorEmmanuele Bassi <ebassi@gnome.org>
Thu, 12 Nov 2020 00:36:32 +0000 (00:36 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Thu, 12 Nov 2020 00:36:32 +0000 (00:36 +0000)
There are a few widgets that gained an accessible role, which means
adding an "Accessibility" section in their description.

gtk/gtkbox.c
gtk/gtkcenterbox.c
gtk/gtkenums.h
gtk/gtkgrid.c
gtk/gtkheaderbar.c
gtk/gtknotebook.c
gtk/gtkscrolledwindow.c
gtk/gtkviewport.c
gtk/gtkwindow.c
gtk/gtkwindowcontrols.c
gtk/gtkwindowhandle.c

index 39aafdecd8a10bd6722262dce4fe20b1c3ebbfd7..957678a3c0bcd4173446ed2fd4db660072b30c20 100644 (file)
  * # CSS nodes
  *
  * GtkBox uses a single CSS node with name box.
+ *
+ * # Accessibility
+ *
+ * GtkBox uses the %GTK_ACCESSIBLE_ROLE_GROUP role.
  */
 
 #include "config.h"
index 097d1350174bf19ae63075718665b896dbd33986..9ea5a241e0f49a52bf3ba3f7bc787280f8f2fbb6 100644 (file)
  *
  * In vertical orientation, the nodes of the children are arranged from top to
  * bottom.
+ *
+ * # Accessibility
+ *
+ * GtkCenterBox uses the %GTK_ACCESSIBLE_ROLE_GROUP role.
  */
 
 #include "config.h"
index 8f0f7edc983f3628a6b3a41888ed09907bdf2846..206fdbef12c114068f2a58df0917fa0dc7f56815 100644 (file)
@@ -1136,7 +1136,8 @@ typedef enum {
  * @GTK_ACCESSIBLE_ROLE_GENERIC: Unused
  * @GTK_ACCESSIBLE_ROLE_GRID: A grid of items.
  * @GTK_ACCESSIBLE_ROLE_GRID_CELL: An item in a grid or tree grid.
- * @GTK_ACCESSIBLE_ROLE_GROUP: Unused
+ * @GTK_ACCESSIBLE_ROLE_GROUP: An element that groups multiple widgets. GTK uses
+ *   this role for various containers, like #GtkBox, #GtkViewport, and #GtkHeaderBar.
  * @GTK_ACCESSIBLE_ROLE_HEADING: Unused
  * @GTK_ACCESSIBLE_ROLE_IMG: An image.
  * @GTK_ACCESSIBLE_ROLE_INPUT: Abstract role.
index 4c21f298064c6ee9457437b8f62e06dc1f6b7106..4f8d35492e137878e62d6e582cfd51bfbfe9e8f9 100644 (file)
  *
  * # CSS nodes
  *
- * GtkGrid uses a single CSS node with name grid.
+ * GtkGrid uses a single CSS node with name `grid`.
+ *
+ * # Accessibility
+ *
+ * GtkGrid uses the %GTK_ACCESSIBLE_ROLE_GROUP role.
  */
 
 typedef struct
index 745d5ce6720a85d96e5dffd254165b1b76f8b23f..9006bea9e068f02a74163dde04b0b8d04f03fe6c 100644 (file)
  *             ╰── windowcontrols.end
  * ]|
  *
- * A #GtkHeaderBar's CSS node is called headerbar. It contains a windowhandle
- * subnode, which contains a box subnode, which contains two box subnodes at
- * the start and end of the headerbar, as well as a center node that represents
+ * A #GtkHeaderBar's CSS node is called `headerbar`. It contains a `windowhandle`
+ * subnode, which contains a `box` subnode, which contains two `box` subnodes at
+ * the start and end of the header bar, as well as a center node that represents
  * the title.
  *
- * Each of the boxes contains a windowcontrols subnode, see #GtkWindowControls
+ * Each of the boxes contains a `windowcontrols` subnode, see #GtkWindowControls
  * for details, as well as other children.
+ *
+ * # Accessibility
+ *
+ * GtkHeaderBar uses the %GTK_ACCESSIBLE_ROLE_GROUP role.
  */
 
 #define MIN_TITLE_CHARS 5
index 945a13da6af18b40578d9d4ad74946b47a13cadb..4daddb7b76fe24365f507b08714d939e82620caf 100644 (file)
  *     ╰── <child>
  * ]|
  *
- * GtkNotebook has a main CSS node with name notebook, a subnode
- * with name header and below that a subnode with name tabs which
- * contains one subnode per tab with name tab.
+ * GtkNotebook has a main CSS node with name `notebook`, a subnode
+ * with name `header` and below that a subnode with name `tabs` which
+ * contains one subnode per tab with name `tab`.
  *
  * If action widgets are present, their CSS nodes are placed next
- * to the tabs node. If the notebook is scrollable, CSS nodes with
- * name arrow are placed as first and last child of the tabs node.
+ * to the `tabs` node. If the notebook is scrollable, CSS nodes with
+ * name `arrow` are placed as first and last child of the `tabs` node.
  *
- * The main node gets the .frame style class when the notebook
+ * The main node gets the `.frame` style class when the notebook
  * has a border (see gtk_notebook_set_show_border()).
  *
- * The header node gets one of the style class .top, .bottom,
- * .left or .right, depending on where the tabs are placed. For
- * reorderable pages, the tab node gets the .reorderable-page class.
+ * The header node gets one of the style class `.top`, `.bottom`,
+ * `.left` or `.right`, depending on where the tabs are placed. For
+ * reorderable pages, the tab node gets the `.reorderable-page` class.
  *
- * A tab node gets the .dnd style class while it is moved with drag-and-drop.
+ * A `tab` node gets the `.dnd` style class while it is moved with drag-and-drop.
  *
  * The nodes are always arranged from left-to-right, regardless of text direction.
  *
  * # Accessibility
  *
- * GtkNotebook uses the #GTK_ACCESSIBLE_ROLE_TAB_LIST and
- * #GTK_ACCESSIBLE_ROLE_TAB roles for its list of tabs and the
- * #GTK_ACCESSIBLE_ROLE_TAB_PANEL for the pages.
+ * GtkNotebook uses the following roles:
+ *
+ *  - %GTK_ACCESSIBLE_ROLE_GROUP for the notebook widget
+ *  - %GTK_ACCESSIBLE_ROLE_TAB_LIST for the list of tabs
+ *  - %GTK_ACCESSIBLE_ROLE_TAB role for each tab
+ *  - %GTK_ACCESSIBLE_ROLE_TAB_PANEL for each page
  */
 
 
index 52a8ac77d40e54ffa93158ee93ecc40a2f52dcee..09624cdc02485c5aed2d0f72da55756a789ca99d 100644 (file)
  *
  * If both scrollbars are visible, the area where they meet is drawn
  * with a subnode named junction.
+ *
+ * # Accessibility
+ *
+ * GtkScrolledWindow uses the %GTK_ACCESSIBLE_ROLE_GROUP role.
  */
 
 
index 8fdef6123d680e5c60463ed395ca4f86a9829054..42bf850864297ffe0c333b684472d632db68d741 100644 (file)
  *
  * # CSS nodes
  *
- * GtkViewport has a single CSS node with name viewport.
+ * GtkViewport has a single CSS node with name `viewport`.
+ *
+ * # Accessibility
+ *
+ * GtkViewport uses the %GTK_ACCESSIBLE_ROLE_GROUP role.
  */
 
 typedef struct _GtkViewportPrivate       GtkViewportPrivate;
index 68889591e7c1827597be28b8ae5029ea85b4db10..085e54b78804bff53ea4dce87966d67fecbf410a 100644 (file)
  *
  * # Accessibility
  *
- * GtkWindow uses the #GTK_ACCESSIBLE_ROLE_WINDOW role.
+ * GtkWindow uses the %GTK_ACCESSIBLE_ROLE_WINDOW role.
  */
 
 #define MENU_BAR_ACCEL GDK_KEY_F10
index 7278dfafff892db2692d5e99aac06b9f4d541ba9..553cbbdf0f79293717d728b02932f931b743990a 100644 (file)
  * and #GtkWindowControls:decoration-layout value.
  *
  * When #GtkWindowControls:empty is %TRUE, it gets the .empty style class.
+ *
+ * # Accessibility
+ *
+ * GtkWindowHandle uses the %GTK_ACCESSIBLE_ROLE_GROUP role.
  */
 
 struct _GtkWindowControls {
index fca0c3440df7571a909540bfd50417a4a58f6eb5..5a6beeb273e57c60b88fc42178f029945675e4a1 100644 (file)
  *
  * # CSS nodes
  *
- * #GtkWindowHandle has a single CSS node with the name windowhandle.
+ * #GtkWindowHandle has a single CSS node with the name `windowhandle`.
+ *
+ * # Accessibility
+ *
+ * GtkWindowHandle uses the %GTK_ACCESSIBLE_ROLE_GROUP role.
  */
 
 struct _GtkWindowHandle {